Method for controlling cache memory of storage device

ABSTRACT

In order to solve problems that, when the use area used by data of a certain kind reaches the upper limit value, the cache memory cannot be used even though a space area exists in the use area used by data of other kind and utilization efficiency of the cache memory decreases, and that, when the upper limit value of the use area is discarded, on the other hand, data inside the area held is replaced by other data and disappears, a storage area of a size of a minimum guarantee value corresponding to each computer is set inside a disk cache memory in a control device of a storage device connected to a plurality of computers and a storage area is allocated to each computer in accordance with priority corresponding to each computer.

INCORPORATION BY REFERENCE

The present application claims priority from Japanese application JP2004-158627 filed on May 28, 2004, the content of which is hereby incorporated by reference into this application.

BACKGROUND OF THE INVENTION

This invention relates to a cache control technology of a storage device.

A cache memory is disposed inside a storage device so that an access from the second and on to the same data can be read out from the cache memory and a high speed access can be made.

Since the capacity of the cache memory is smaller than that of a disk device, however, it is difficult to arrange all the data in the cache memory. Therefore, the data to be arranged on the cache memory must be selected.

According to the prior art technology described in JP-A-2003-330792, the data to be stored in the cache memory are divided into those having high frequency of use and those having low frequency of use, the use area of the cache area is divided correspondingly and an upper limit size is set to each use area to prevent the data having high use frequency from being purged out by the data having low use frequency and to improve a cache hit ratio.

SUMMARY OF THE INVENTION

In the method for controlling the cache memory according to the prior art that relies on the data kind based on the use frequency, the upper limit size of the use area must be decided in advance. Therefore, when the use area used by the data of a certain kind reaches the upper limit value, for example, the cache memory cannot be used any more even though a space area exists in the use area used by other kind of data and utilization efficiency of the cache memory is low. When the upper limit value of the use area is discarded to effectively utilize this space area, on the other hand, the space area can be eliminated, it is true, but the problem occurs in that a new area cannot be secured because almost all the areas are occupied by other computers and the data held inside the area is replaced by other data. This problem is likely to occur particularly when input/output requests are generated substantially simultaneously from a plurality of computers to the storage device and moreover when a plurality of input/output requests are not distinguished from one another in processing.

It is therefore an object of the invention to provide a method for controlling a cache memory of a storage device that can effectively utilize a space area.

To accomplish this object, the invention sets storage areas each having a minimum guarantee value expressing a size of a storage area to be minimum secured in such a manner as to correspond to each computer by the number of areas having a predetermined size inside a disk cache memory in a control device of a storage device connected to a plurality of computers, and allocates a storage area to each computer inside the storage areas other than the storage area having the minimum guarantee value in accordance with priority which determines a priority order for securing the storage area inside the cache memory in such a manner as to correspond to each computer. In the invention, the priority and the minimum guarantee value for each computer are in advance scheduled and are rendered variable in accordance with a time zone.

Even when the major proportions of the storage area inside the cache memory are occupied by other computers, the invention makes it possible to secure the storage area having the minimum guarantee value. Because the storage area is allocated from the space area in accordance with the priority corresponding to the computer, the cache memory can be utilized effectively in accordance with the form of utilization.

Other objects, features and advantages of the invention will become apparent from the following description of the embodiments of the invention taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a system configuration of a disk device and hosts connected to the disk device;

FIG. 2 is a detailed view of cache control information 144;

FIG. 3 is a detailed view of path definition information 210;

FIG. 4 is a detailed view of slot management information 211;

FIG. 5 is a detailed view of queue management information 212;

FIG. 6 is a detailed view of schedule definition information 145;

FIG. 7 shows a flow of input/output to and from a logical volume;

FIG. 8 shows a flow of input/output to and from control information 142;

FIG. 9 shows an operation of a cache control portion 143 when an input/output request to a logical volume 171 is accepted;

FIG. 10 is a flowchart of a processing operation for updating cache control information when a read instruction is executed;

FIG. 11 is a flowchart showing an operation of a slot selection processing;

FIG. 12 is a flowchart of a processing operation for updating cache control information when a write instruction is executed;

FIGS. 13A to 13C show an embodiment of path information and queue information;

FIG. 14 shows an embodiment of slot management information 211;

FIGS. 15A to 15D show an embodiment of input/output using a logical volume as an object;

FIG. 16 shows an operation flow of a cache control processing 143 when an input/output 1510 (read; when data exists on cache) is executed;

FIG. 17 shows an operation flow of the cache control processing 143 when an input/output 1520 (write; when data does not exist on cache) is executed;

FIG. 18 shows an operation flow of the cache control processing 143 when an input/output 1530 (write) is executed;

FIGS. 19A to 19D show an embodiment of input/output to path information;

FIGS. 20A to 20B show an embodiment of path information;

FIG. 21 shows an operation of schedule;

FIG. 22 is an embodiment of schedule information;

FIG. 23 shows an outline of the invention; and

FIG. 24 shows a construction of an allocated storage area in a queue.

DESCRIPTION OF THE. EMBODIMENT

An embodiment of the invention will be explained. FIG. 1 shows a system configuration of a storage device and host computers (hereinafter called “hosts”) connected to the storage device.

The system according to this embodiment includes at least one host 110, a storage device 120, a control terminal 190 and a storage device 191.

The host 110 is connected to the storage device 120 through a port 113. Connection of the port 113 to the storage device 120 is not limited to wiring shown in the drawing but may use SAN (Storage Area Network), etc.

The host 110 is an ordinary computer including a main memory device (hereinafter called “memory”) storing an application 111 and an operating system 112 and CPU (processing unit) for executing these programs.

The application 111 can request input/output to the operating system 112.

The operating system 112 accepts the input/output request from the application 111, generates an instruction for the logical volume 171, whenever necessary, and operates the input/output instruction.

The storage device 120 includes a disk control device 130 and a disk device 170. The disk control device 130 and the disk device 170 are wire-connected.

The disk control device 130 has ports 131, a control program 132, a cache memory 133, an internal timer 134, a port 135, a main memory device (hereinafter called “memory”) storing the control program 132 and a CPU (processing unit) for executing the program. The ports 131, the cache memory 133, the internal timer 134, the port 135, the memory and the CPU are connected mutually through internal buses. The control program 132 may exist either in the memory inside the disk control device 130 or in the host 110 connected to the disk control device 130 through the input/output path 131. This embodiment represents an example where the control program 132 exists in the memory inside the disk control deice 130.

Connection of the port 131 to the host 110 is not limited to wiring shown in the drawing but may use connection by SAN, or the like.

The control program 132 includes an input/output acceptance processing 140, a control information updating processing 141, control information 142, a cache control processing 143, cache control information 144, schedule definition information 145 and a schedule execution processing 146 and controls input/output sent from the host 110 and a control terminal 190.

The cache memory 133 has a plurality of cache slots 150. Each cache slot 150 is a unit of a storage area constituted by an area obtained by equally dividing the cache memory 133. A unit of a logical storage area may be constituted as the cache slot 150 by gathering fragments of areas arranged physically dispersedly.

The internal timer 134 is a timepiece held by the disk control device 132.

The port 135 is a connection portion with the control terminal 190.

The control terminal 190 is an ordinary computer including a network interface 192, an operating system 193, a main memory device (hereinafter called “memory”) storing a management program (one of applications) 194 and a CPU (processing unit) for executing these programs. Unlike the host 110, the control terminal 190 is a computer directed to control the storage device 120.

The control terminal 190 is connected to the storage device 120 through the network interface 192. Connection of the control terminal 190 to the storage device 120 is not limited to wiring shown in the drawing but may be connection using SAN, or the like. The management program 194 can generate the input/output request through the operating system 193 and the network interface 192.

A storage device 191 is connected to the control terminal 190. The storage device 191 may be of any type of a medium so-long as it can store an operation result of the control terminal 190. It is possible to take out the content of the control information 142 from the input/output request from the management program 194 and to store it as a definition file 197 in the storage device 191.

The disk driving device 170 has at least one logical volume 171. The logical volume 171 stores data 172 that can be read and written in accordance with the input/output request from the application 111. It is also possible to take out the content of the control information 142 from the input/output request from the application 111 and to store it as the definition file 173 in the logical volume 171.

FIG. 23 shows the outline of the invention. The data storage area of the cache memory 133 provided to the disk controller 130 connected to the two hosts (CPU) 110 is constituted by a plurality of cache slots each having a predetermined size. Priority determining in advance a priority order of securing the storage area inside the cache memory is allocated to each host 110, and the number of cache slots is also allocated to each host 110 in accordance with input/output to and from the cache memory 133. A minimum guarantee value expressing in advance the size of a minimum storage area to be secured by the number of cache slots is allocated to each host 110. Even when other host having a higher priority expands the size of the storage area (the number of cache slots), the number of cache slots of the minimum guarantee value is allocated to the host and are secured lest the data accessed by the host is excluded from the cache memory 133.

In the invention, the data storage area inside the cache memory 133 is managed in the unit of the cache slot having a predetermined size. Therefore, the distribution of the data storage area corresponding to each host changes in the unit of the cache slot in accordance with input/output to and from the cache memory 133. The distribution of a plurality of cache slots within the range of the minimum guarantee value changes in the unit of the cache slot, too. In other words, the number of the minimum guarantee value of the cache slots is secured either always or at minimum in whichever way a plurality of cache slots may be distributed. For example, even when the data quantity is small as in the initial stage, the number of cache slots corresponding to the minimum guarantee value is secured. In other words, the number of cache slots of the minimum guarantee value is not practically allocated as the storage area in the invention but only the minimum guarantee value as the number of cache slots to be minimum secured is set and control is so made as to secure this number.

In the environment in which a plurality of hosts are connected to the same storage device, control for allocating a priority to a specific host is sometimes effective. In a system configuration in which different hosts execute batch work and on-line work and each host uses in common the same storage device, the on-line work is not retarded when a priority of input/output is allocated to the host of the on-line work. This invention executes control of the cache slots so that the data from the path (computer) having a priority is much arranged inside the cache memory and can in this way distinct the processing time of the input/output request for each path. The cache memory quantity can be flexibly controlled by conducting reference/updating of control information (priority, minimum guarantee value, schedule definition) of the cache memory quantity in accordance with an external instruction. For example, the control information of the cache memory quantity (later-appearing priority, minimum guarantee quantity, schedule definition) can be set from the control terminal 190 or from any of a plurality of hosts 110.

FIG. 2 is a detailed view of the cache control information 144.

The cache control information 144 includes path definition information 210, cache slot management information 211 and queue management information 212.

FIG. 3 is a detailed view of the path definition information 210.

The path definition information 210 has a plurality of path definition entries 310. The path definition entry 310 includes a path identifier 320, a priority 321 and a cache slot minimum guarantee value 322. Since the path between the host 110 and the disk controller 130 is one each for each host in this embodiment, the path identifier 320 has the meaning of an identifier for discriminating the host 110, too. The path and the host correspond to each other on the 1:1 basis to simplify the explanation.

The path definition information 210 can be looked up and updated by the input/output request from the application 111 on the host 110 or the management program 194 on the control terminal 190.

The path identifier 320 is information for identifying the queue of the cache slots constituting the data storage area of the cache memory. The queue of the cache slots has a link structure in which the cache slots are linked with one another in the sequence of allocation. The number of queues is the number of hosts plus 1 because an invalid cache slot (a cache slot which does not store effective data and is an object for securing a new area) must be managed besides identification of each host.

The information for identifying the host making the input/output request indicates a path group identifier, a host identifier, etc, for example, and any information may be used so long as it can primarily identify the host.

The priority 321 indicates a preferential order of using the cache slots 150 among different hosts and may be a unique value for all the hosts, or a plurality of hosts having the same priority may exist. The priority among the hosts can be changed by the external instruction in accordance with the operation condition. However, the priority 321 of the path identifier for managing the invalid cache slot is a fixed value and is the lowest among all the priorities. When the priority is provided, the content of the cache slot 150 under use is not easily excluded by the host having a lower priority when the input/output is made from the host having a higher priority. Since the priority 321 of the path identifier for managing the invalid cache slot is the lowest, it becomes possible to reduce as much as possible the invalid cache slots and to effectively utilize the cache memory.

The cache slot minimum guarantee value 322 is the minimum number of cache slot identifiers that the queue can hold. The cache slot minimum guarantee value 322 can be changed by the external instruction in accordance with the operation condition. However, the cache slot minimum guarantee value 322 of the path identifier for managing the invalid cache slot is fixed and the slot number minimum guaranteed does not exist.

Since the cache slot minimum guarantee value 322 is set for each host, the minimum necessary cache memory capacity the host can utilize is secured. Since the slot number of the invalid cache slot minimum guaranteed is eliminated, the number of invalid cache slots can be as much as reduced and the cache memory can be effectively utilized.

FIG. 4 is a detailed view of the cache slot management information 211.

The cache slot management information 211 holds the state of each cache slot 150. The cache slot information 211 has a plurality of cache slot management entries 410. The state of one cache slot 150 is set to the cache slot management information 410. The cache slot management entry 410 has a cache slot identifier 420 and a path identifier 421. The cache slot identifier 420 is information for primarily identifying the cache slot 150. The path identifier 421 is information representing the input/output requesting host using the cache slot 150 or the invalid cache slot and is the same information as the cache identifier 320. Data storage position information 422 is information representing the storage position of the data 172 stored in the cache slot represented by the cache slot identifier 420. The data storage position information 422 may be of any type so long as it primarily represents the storage position in the logical volume such as the logical address, the sector number, the cluster number, and so forth.

FIG. 5 is a detailed view of queue management information 212.

The queue management information 212 has a plurality of queue entries 510. A queue of the cache slot used for each input/output requesting host or a queue for managing the invalid cache slot is set to one queue entry 510. The path information 520 is information for identifying the queue for managing the input/output requesting host for the invalid cache slot. When the cache slot is allocated to the input/output requesting host, the same information as the path identifier 320 is stored in the path identifier 520 and in the case of the invalid cache slot, the information that does not coincide with any path identifier information is stored. A queue header 521 represents the information of one queue and there are the case where it has a plurality of cache slot identifiers 420 and the case where it does not hold the cache slot identifier 420 (the case of invalid cache slot). Cache slot use quantity 522 is information representing the number of cache slots the queue has.

When one queue has a plurality of cache slot identifiers 420, the queue header 521 stores information representing the link structure constituted by a plurality of cache slots constituting the queue. In other words, the queue header 521 stores the information representing the connection relation among a plurality of cache slot identifiers 420 in the queue. In this connection relation, the cache slot identifiers 420 are linked in the order of allocation of the cache slots. Therefore, the data of the cache slot positioned at the leading position of the queue is old and the data of the cache slot positioned at the tail is new. As shown in FIG. 5, the queue header 521 serially stores the cache slot identifiers 420 of the cache slots connected ahead and after this cache slot. The information of the connection relation shown in FIG. 5 represents the link structure that corresponds to the queue B shown in later-appearing FIG. 13. Incidentally, the previous slot of the leading cache slot stores “-” and the slot after the last cache slot stores “-”.

FIG. 6 shows in detail the schedule definition information 145.

The schedule definition information 145 has a plurality of schedule definition entries 610 for setting scheduling of the path definition. The schedule definition entry 610 has data 620, time 621 and new path definition information 622. A schedule execution processing 146 monitors the internal timer 134 and rewrites the existing path definition information 210 to new path definition information 622 when the data and the time reach predetermined date 620 and time 621.

The schedule definition information 145 is the information that the schedule execution processing 146 looks up.

The schedule execution processing 146 monitors the internal timer 134 and updates the cache control information 144 when the time registered to the schedule definition information 145 is reached. Because the cache control information 144 is updated at the specific time, the access control from the host 110 can be flexibly made.

Next, input/output in the system shown in FIG. 1 will be explained.

The objects of the input/output request in the invention are two kinds, that is, the logical volume 171 and control information 142. The input/output having the logical volume 171 as the object is input/output for reading/writing the data inside the logical volume. On the other hand, the input/output to and from the control information 142 exists as means for operating from outside the control information in the invention.

FIG. 7 shows the flow of the input/output to and from the logical volume 171.

The input/output request from the application 111 operating on the host 10 is transferred to the storage device 120 through the operating system 112 and the port 113.

The input/output request reaching the storage device 120 is accepted by the port 131 and is transferred to the control program 132.

The input/output acceptance processing 140 accepts the input/output request from the port 131. The input/output acceptance processing 140 then judges and assorts the input/output request. When the object of the input/output request is the control information 142, the input/output request is transferred to the control information updating processing 141.

The cache control processing 143 is a program for controlling the cache memory 133. The program looks up and updates the cache control information 143 and the cache memory 133, gains access to the logical volume 171, whenever necessary, and executes the input/output request.

After the execution of the input/output request is complete, the input/output completion is reported to the application 111 in the reverse sequence to that of the acceptance.

FIG. 8 shows the flow of the input/output request processing to and from the control information 142.

The input/output request to and from the control information 142 is executed by the application 111 operating on the host 110 or the control terminal 190 or by the management program 194. When the application 111 outputs the input/output request to the control information 142, the input/output request is transferred to the input/output acceptance processing 140 through the operating system 112, the port 113 and the port 131 in the same way as the input/output to and from the logical volume 171. The input/output acceptance processing 140 judges the input/output request and assorts it to the control information updating processing 141 when it is the input/output to the information control 142. The control information updating processing 141 looks up and updates the path definition information 210 inside the cache control information 144 or the date 620, the time 621 and the new path definition information 622 inside the schedule definition information 145.

After updating of the control information 142 is complete, the input/output completion is reported to the application 111 in the reverse sequence to the input/output acceptance.

When the management program 194 outputs the input/output request to the control information 142, the input/output request is transferred to the control information updating processing 141 through the operating system 193, the network interface 192 and the port 135. The subsequent operation is the same as the input/output operation requested by the application 111. The operation not dependent on the operating condition of the host 110 can be made when the management program 194 operating on the control terminal 190 looks up and updates the path definition information 210 and the schedule definition information 145.

Incidentally, those kinds of information which the application 111 and the management program 194 acquire from the path definition information 210 and the schedule definition information can be stored as a definition file when the input/output to the logical volume 171 or the storage device 191 is executed. The application 111 and the management program 194 can execute input/output to and from the control information 142 on the basis of the definition file 173 and the definition file 197. The control information can be updated from various computers when the definition file 173 and the definition file 197 are copied or are allowed to be looked up from other computers.

FIG. 9 is a flowchart showing the operation of the cache control processing 143 when the input/output request to the logical volume 171 is accepted.

After the input/output request to the volume is accepted, the cache control processing 143 takes out the first instruction (Step 900) and judges the kind of the instruction (Steps 901 and 902). When the instruction is a read instruction or a write instruction, the cache control processing 143 executes the updating processing of the cache control information (Steps 903 and 904). The operation of the cache control information updating processing is different between the read instruction and the write instruction and the detail will be described later. Thereafter, the read or write instruction of the data is executed (Step 905) and the operations from Step 901 to Step 905 are repeated to the last instruction (Steps 906 and 907). Finally, the input/output completion is reported to the host (Step 908).

FIG. 10 is a flowchart of the updating processing 903 of the cache control information for the read instruction shown in FIG. 9.

To judge whether or not the data 172 designated by the input/output request exists on the cache memory 133, the cache slot identifier 420 in which the data designated by the input/output request is stored is retrieved (Step 1000). The information representing the correspondence relation between the data 172 and the cache slot identifier 420 of the cache slot storing the data and necessary for this retrieval is stored in the cache slot management information 211 shown in FIG. 4.

When the data on the cache memory 133 represented by the cache slot identifier 420 in the cache slot management information 211 is coincident with the data 172, the data 172 is judged as existing on the cache memory 133 (Step 1001).

Next, the path definition entry 310 in which the input/output path information added to the input/output request is coincident with the path identifier 320 in the path definition information 210 is retrieved and whether or not the priority 321 in the path definition entry 310 retrieved is higher than the priority 321 of the cache slot retrieved in Step 1000 is judged (Step 1002). When the priority 321 in the path definition entry 310 retrieved is higher than the priority 321 of the cache slot retrieved in Step 1000, the cache slot of the cache slot identifier retrieved in Step 1000 is taken out from the queue and is registered to the tail of the queue corresponding to the input/output path (Step 1003) and the path identifier 421 of the cache slot management information 211 is updated to that of the input/output request (Step 1004).

In Step 1002, when the priority 321 in the path definition entry 310 retrieved is not judged as being higher than the priority 321 of the cache slot retrieved in Step 100, nothing is done and the priority 321 corresponding to the data 172 existing on the cache memory 133 becomes the priority 321 in the path definition entry 310 retrieved.

When the data 172 designated by the input/output request does not exist on the cache memory 133, that is, when the data on the cache memory 133 represented by the cache slot identifier 420 does not coincide with the data 172, a cache slot selection processing is executed (Step 1006). In the cache slot selection processing, a processing that selects the cache slot for saving the content of the invalid cache slot or the cache memory to the logical volume and takes out the cache slot identifier for reading out afresh from the queue is executed. The cache slot selected in Step 1006 is registered to the tail of the queue coincident with the input/output path identifier (Step 1007) and the path identifier 421 of the cache slot management information 221 is updated to that of the input/output path (Step 1008).

FIG. 11 is a flowchart showing the operation of the cache slot selection processing 1006 shown in FIG. 10.

The cache slot use quantity 522 of the queue registered to the queue header 521 decided by the path identifier 520 in the queue entry 510 of the queue management information 212 is compared with the cache slot minimum guarantee value 322 decided by the path identifier 320 in the path definition entry 310 in the path definition information 210. As a result, the input/output path having the lowest priority 321 among the input/output paths the cache slot use quantity 522 of which exceeds the cache slot minimum guarantee quantity 322 is retrieved from the path definition information 210 (Steps 1100 and 1101). When the input/output path the cache slot use quantity 522 of which exceeds the cache slot minimum guarantee value 322 is found out, the cache slot identifier is taken out in the LRU (Least Recently Used) system from the queue retrieved in Step 1100 (Step 1102). When such an input/output path is not found out, the cache slot identifier is taken out in the LRU system from the queue having the lowest priority among the queues to which the cache slot identifier is registered (Step 1103).

Unless the cache slot taken out by the processing described above is the invalid cache slot, the data on the cache memory is written to the logical volume (Step 1104) and this cache slot is used as the cache slot to be used in the subsequent processing.

FIG. 12 is a flowchart showing the operation of the write processing 904 shown in FIG. 9. To write the data designated by the input/output request to the cache in the write processing, the cache slot selection processing described above for saving the content written to the cache slot is executed (Step 1200). The cache slot identifier is taken out from the queue of the cache slot 150 selected in Step 1200 and is inserted to the tail of the queue corresponding to the input/output path (Step 1201). Furthermore, the path identifier 320 is updated to the input/output path information (Step 1202) to display that this cache slot is used in the input/output path.

An embodiment of the input/output to the logical volume in the invention will be explained with reference to FIGS. 13 to 18.

FIG. 13 shows an embodiment of path definition information 210 (FIG. 13A) and queue management information (FIG. 13B).

In this embodiment, the hosts A and B are connected to the disk device. The path identifier 1300 is “host A” and “host B”, respectively. The path definition entry in which the path identifier 1300 is “invalid” manages the invalid cache slots that do not belong to any path (hereinafter called “invalid entry”). The priority 1301 having a lower numerical value has a higher priority in this embodiment. The priority 1301 of the invalid entry is the lowest among all the priorities and the cache slot minimum guarantee value 1302 of the invalid entry is 0.

The cache slot use quantity 1305 is decided depending on the condition of the queue. The queue header 1304 of the hosts A and B and the invalid entry represents the queue A, the queue B and the queue C, respectively. Each queue has a cache slot identifier shown in FIG. 13 C). The queue 1310 has cache slot identifiers “1” and “2”. The queue 1311 has cache slot identifiers “3, “4”, “5” and “6”. The queue 1312 manages the cache slot identifier of the invalid entry. The queue 1310 has the cache slot identifier “0”.

FIG. 24 shows the relation between the number of cache slots allocated to each queue and the cache slot minimum guarantee value 322. The cache slots are serially linked in each queue and the cache at the start is old and a new cache slot is linked to the tail.

The link structure of the cache slots shown in FIGS. 13 and 24 can be accomplished by adding the cache slot identifier of the cache slot linked before and after the cache slot as shown in the queue entry 510 of FIG. 5.

FIG. 14 shows an embodiment of the cache slot management information 211.

It will be assumed that the cache memory 133 is equally divided, each has cache slot identifiers “0” to “6” and each cache slot identifier primarily decides the data address on the cache memory 133. This embodiment uses the logical volume identifier and the logical address as data storage position information 1402.

For example, it will be assumed that the cache slots having the cache slot identifiers of “0” to “6” in the sequence of the data address of a smaller value on the cache memory 133 are stored. The data address designated by the cache slot identifier “0” on the cache memory 133 is the address that does not use any path and the path identifier is “invalid”. Similarly, the cache slot identifiers “1” and “2” represent the data addresses on the cache memory that the path identifier “host A” uses, and the cache slot identifiers “3”, “4”, “5” and “6” represent the data addresses on the cache memory that the path identifier “host B” uses.

As for the logical address, too, it will be assumed that the cache slot identifier “0” is “invalid” and the cache slot identifiers “1” to “6” are “ADR1” to “ADR6”, respectively. As for the logical volume identifier, it will be assumed further that the cache slot identifier “0” is “invalid” and all the others are “VOL0”.

FIG. 15 shows an embodiment of an input/output request directed to the logical volume.

The input/output 1500 shown in FIG. 15A has a logical volume identifier 1501, a path identifier 1502, an instruction 1503 and a parameter 1504. The logical volume identifier 1501 is information that primarily identifies the input/output object device. The instruction 1503 is an instruction kind such as read/write/control and the parameter 1504 is the information used for the instruction 1503. The parameter 1504 is the information used for the instruction 1503 and is control information such as the logical address as the input/output object and magnetic head positioning. Other information may be used depending on the kind of the input/output object device.

The input/output 1510 shown in FIG. 15B is the one that is requested by the host of the path identifier “host B” and is for reading the logical address “ADDR5” on the logical volume identifier “VOL0”. The input/output 1520 shown in FIG. 15C is the one that is requested by the host of the path identifier “host A” and is for reading the logical address “ADDR7” on the logical volume identifier “VOL0”. The input/output 1530 shown in FIG. 15D is the one that is requested by the host of the path identifier “host A” and is for writing the data “XYZ” to the logical address “ADDR8” on the logical volume identifier “VOL0”.

FIG. 16 shows an operation flow of the cache control processing 143 when the input/output 1510 (read; data exits on cache) shown in FIG. 15B is executed. First, the magnetic head positioning instruction is taken out (Step 1600) and the magnetic head is positioned to the position designated by the parameter (Step 1601). Next, the subsequent instruction (read instruction) is taken out (Step 1602) and the read processing is executed (Step 1603). Since the data exists on the cache in this case, read of the data from the actual medium is not executed and the data is read from the cache in the subsequent processing.

First, to acquire the cache that holds the object data, the data storage position information 422 representing the corresponding relation between the data and the cache slot identifier, that is described in Step 1000 in FIG. 10 and is held in the cache slot management information 211 shown in FIG. 4, is retrieved (Step 1604) and the cache slot having the logical address “ADDR5” as the read object is acquired. It will be assumed hereby that the cache slot having the cache slot identifier “5” is acquired. The content of the cache slot of the cache slot identifier “5” is transferred to the host B (Step 1605). Finally, input/output completion is reported to the host B (Step 1606).

FIG. 17 shows an operation flow when the input/output 1520 (read; no data exists on cache) shown in FIG. 15C is executed. Steps 1700 to 1702 are the same as those of the case of the input/output 1510 (read; data exists on cache) shown in FIG. 16 but the following processing is executed in Step 1703 because the data does not exist on the cache.

First, a cache slot search processing is executed to acquire the cache to which the data is to be saved (Step 1704). In this processing, the cache slot of the cache slot identifier “0” that does not belong to any path and is an invalid cache slot is selected. The cache slot of the cache slot identifier “0” is taken out from the queue C and is inserted to the tail of the queue A of the cache slot used by the path identifier “host A” (Step 1704). Furthermore, the data read from the volume identifier “VOL0” and the logical address “ADDR7” is transferred to the cache slot of the cache slot identifier “0” (Step 1705) and the content of the cache slot of the cache slot identifier “0” is transferred to the host (Step 1706). The cache slot use quantity used by the path identifier “host A” is thereafter updated (Step 1707) and the logical volume identifier, the logical address and the path identifier are updated to “VOL0”, “ADDR8” and “host A”, respectively (Step 1708). Finally, input/output completion is reported to the host A (Step 1709).

FIG. 18 shows an operation flow of the cache control processing 143 when the input/output 1530 (write) shown in FIG. 15 D) is executed. Steps 1800 to 1802 are the same as those of the input/output 1510 shown in FIG. 16. In this case, too, the queue and the path identifier are updated in the same way as read. The updating sequence is as follows.

First, the cache slot search processing is executed to acquire the cache to which the data is to be saved (Step 1803). In this processing, the cache slot of the cache slot identifier “0” that is the invalid cache slot not belonging to any path is selected. The cache slot of the cache slot identifier “0” is taken out from the queue C and is inserted to the queue A of the cache slot used by the path identifier “host A” (Step 1804). The cache slot use quantity used by the path identifier “host A” is updated (Step 1805).

The logical volume identifier, the logical address and the path identifier are updated to “VOL0”, “ADDR8” and “host A”, respectively (Step 1806) and the data “XYZ” is transferred to the cache memory positioned by the cache slot of the cache slot identifier “0” (Step 1807). Finally, input/output completion is reported to the host A (Step 1808).

The use quantity of the cache memory can be controlled for each input/output path when the cache slot is controlled in the manner described above.

An embodiment of input/output to the control information 142 in the invention will be explained. In the input/output to the control information 142, it is possible to change the priority and the cache slot minimum guarantee value, to add and delete the path definition entry and to change the schedule definition inside the cache control information 144 and the schedule definition information 145. FIG. 19 shows the embodiment of the input/output to the control information 142.

The input/output for changing the priority shown in FIG. 19A includes an instruction kind 1900, a path identifier 1901 and a priority 1902. This embodiment represents the input/output for changing the priority of the path definition entry 310 having the path identifier “host A” to “1”. When the application requires this input/output, the control information updating processing 141 searches the path definition information 210 and updates the priority when the path definition entry having the path identifier “host A” exists. When it does not exist, the input/output request is regarded as an input/output error.

The input/output for changing the cache slot minimum guarantee value shown in FIG. 19B includes an instruction kind 1910, a path identifier 1911 and a cache slot minimum guarantee value 1912. This embodiment represents the input/output for changing the cache slot minimum guarantee value of the path definition entry having the path identifier “host A” to “2”. When the application requires this input/output, the control information updating processing 141 searches the path definition information 210 and updates the cache slot minimum guarantee value inside the path definition entry when the path definition entry having the path identifier “host A” exists. When it does not exist, the input/output request is regarded as an input/output error.

The input/output for adding the path definition entry shown in FIG. 19C includes an instruction kind 1920, a path identifier 1921, a cache slot minimum guarantee value 1922 and a cache slot minimum guarantee value 1923. This embodiment represents the input/output for adding the path definition entry having the path identifier “host A” and the cache slot minimum guarantee value “2”. When the application requires such an input/output, the control information updating processing 141 searches the path definition information 210 and adds the path definition entry when the path definition entry having the path identifier “host A” does not exist. When it exists, the input/output request is regarded as an input/output error.

The input/output for deleting the path definition entry shown in FIG. 19D includes an instruction kind 1930 and a path identifier 1931. This embodiment represents the input/output for deleting the path definition entry having the path identifier “host A”. When the application requires such an input/output, the control information updating processing 141 searches the path definition information 210 and deletes the path definition entry when the path definition entry having the path identifier “host A” exists. When it does not exist, the input/output request is regarded as an input/output error.

The control information can be set in the manner described above from the host or the application on the control terminal. When the control information is set from the application 194 on the control terminal 190, the operation not depending on the operating condition of the host becomes possible.

The control method described so far prepares the queue for each input/output path. However, only some specific hosts among a large number of hosts connected to the storage device can preferentially utilize the cache memory by setting the same priority to the plurality of hosts.

FIG. 20 shows an embodiment of the path definition information 210.

FIG. 20A shows that a host A, a host B and a host C are connected to the disk device. Here, the host B and the host C have the same number of priority 2001. To avoid collision of the access having the same priority in such a case, the queue of the host B and the host C is shared. To share the queue and to facilitate control of the cache slots, the cache slot minimum guarantee values 2002 of all the paths sharing the queue, the cache slot use quantities 2004 of the queue entries shown in FIG. 20B and the queue header 2005 are set to the same values. In other words, control is made so that the cache slot minimum guarantee values 2002 of the hosts B and C, the cache slot use quantities 2003 and the queue headers 2004 become the same values.

FIG. 21 shows the operation of a schedule.

In the schedule, the cache memory quantity that can be used for each output path is changed at a predetermined time. The schedule is operated in the following sequence.

Schedule definition information 145 is set in advance from the host or the control terminal. FIG. 22 shows an embodiment of the schedule information. Date 2201 can directly designate the month and the day and can also designate “weekday”, “holiday”, day of the week and month. The values after the change are designated to the path identifier 2202, the priority 2203 and the cache slot minimum guarantee value 2204. In the schedule information of the embodiment, four schedule definition entries are registered and the cache memory quantities that the host A and the host B can utilize are controlled.

When the priority and the cache slot minimum guarantee value 220 of each host are switched to new values at a predetermined time on the basis of the schedule definition, allocation control of the storage area is conducted after that time on the basis of the priority and the minimum guarantee value that are set afresh. The distribution of the storage area corresponding to each host gradually changes from the state before switching of the values and gradually reaches the distribution of the storage area based on the priority and the minimum guarantee value set afresh.

For example, the host A having a higher priority secures a greater number of storage areas than the host B having a lower priority from 8:00 to 20:00 of a weekday as shown in FIG. 22 when the invalid cache slots have already been used up. Since the host B has a higher priority than the host A after 22:00, however, the storage areas secured by the host A gradually shift to the storage areas of the host B. In this instance, the data of a part of the storage areas secured by the host A is written out from the cache memory to the disk device and becomes thereafter the storage area of the host B. On the other hand, since the minimum guarantee value of the host increases from “3” to “5” with 20:00 as the boundary, the number of cache slots minimum guaranteed increases while the minimum guarantee value of the host B decreases from “4” to “2”. Consequently, the number of cache slots minimum guaranteed decreases.

In the definition of scheduling described above, control is made in such a manner that the sum of the minimum guarantee value of each path identifier is smaller than the total number of the cache slots in each time zone. When the priority of some path identifiers become the same in each time zone in the definition of scheduling described above, control is made so that the queue corresponding to these path identifiers become the same.

The schedule execution processing 146 monitors the internal timer 134 and the schedule definition information 145. When the time set to the schedule definition information 145 is reached, the content of the path definition information 210 is updated. This processing makes it possible to change the information necessary for the cache management at a specific time and to operate more flexibly the disk device.

It is further possible to display the path definition information shown in FIG. 13A and the schedule definition information shown in FIG. 22 on a display device (not shown) of the control terminal 190 and for the user (manager) to interactively set and change the priority, the minimum guarantee value and the schedule definition through an input device (not shown) such as a keyboard.

In the embodiment described above, the size of each cache slot is assumed to be constant but the size of the respective cache slots can be changed in accordance with the processing form of the application 111 of the host 110. For instance, the load of the allocation processing of the cache slots can be reduced by allocating the cache slots in a greater unit than the ordinary unit for the host for processing large quantities of data such as an image processing that uses in many cases a sequential access besides an ordinary random access. When the size of the cache slots is set in the unit of two or four times the ordinary unit when the cache slots are allocated in the unit greater than the ordinary unit, the number management of the cache slots and the use quantity management become easier.

The program for executing the cache control method of the disk device according to the invention described above can be stored in a computer-readable medium and can be executed by reading the program into the memory.

It should be further understood by those skilled in the art that although the foregoing description has been made on embodiments of the invention, the invention is not limited thereto and various changes and modifications may be made without departing from the spirit of the invention and the scope of the appended claims. 

1. A method for controlling a cache memory of a storage device in a control device of the storage device connected to a plurality of computers, comprising the steps of: setting a storage area having a size of a minimum guarantee value corresponding to each of said computers into a disk cache memory of said storage device; and allocating a storage area in such a manner as to correspond to each of said computers inside a storage area other than said storage area having the size of said minimum guarantee value in accordance with priority corresponding to each of said computers.
 2. The method for controlling a cache memory of a storage device according to claim 1, wherein each of said storage areas corresponding to said computers is constituted by a link structure in which at least one cache slot having a predetermined memory area is linked in the sequence of allocation.
 3. The method for controlling a cache memory of a storage device according to claim 1, wherein, when a storage area corresponding to other computer having higher priority than said computers is expanded, allocation of a storage area having a size corresponding to said minimum guarantee value of said computers to said other computer is inhibited.
 4. The method for controlling a cache memory of a storage device according to claim 1, wherein, when said computer requires a new storage area when an empty area does not exist inside said disk cache memory, the storage area is replaced by a part of storage area of other computer having a lower priority than said computer.
 5. The method for controlling a cache memory of a storage device according to claim 4, wherein, when the storage area is exchanged with said computer having high priority, exchange is made in the sequence of the area storing an old data held by said computer having the lower priority.
 6. The method for controlling a cache memory of a storage device according to claim 1, wherein said priority and said minimum guarantee value corresponding to each of said plurality of computers are scheduled in advance and are rendered variable in accordance with a time zone.
 7. The method for controlling a cache memory of a storage device according to claim 1, wherein a storage area having a size of said minimum guarantee value is secured even when the data quantity corresponding to said computer does not reach said minimum guarantee value.
 8. The method for controlling a cache memory of a storage device according to claim 1, wherein, when some of said plurality of computers has the same priority, said some computers having the same priority share the storage area of said cache memory.
 9. The method for controlling a cache memory of a storage device according to claim 1, wherein said priority and said minimum guarantee value are set through a control terminal connected to said storage device.
 10. The method for controlling a cache memory of a storage device according to claim 6, wherein information for said scheduling is set through a control terminal connected to said storage device.
 11. The method for controlling a cache memory of a storage device according to claim 6, wherein control is made in each time zone in said scheduling so that the sum of said minimum guarantee values corresponding to said computers is smaller than the total number of said cache slots.
 12. The method for controlling a cache memory of a storage device according to claim 2, wherein a corresponding relation between data corresponding to an input/output request from said computer and the cache slot storing said data is held.
 13. The method for controlling a cache memory of a storage device according to claim 2, wherein said cache slot is changed to a link structure corresponding to an input/output when priority corresponding to said input/output request from said computer is higher than priority of said cache slot storing said data corresponding to said request.
 14. The method for controlling a cache memory of a storage device according to claim 2, wherein either a cache slot not allocated to said computer or a cache slot taken out from other link structure is added to the tail of a link structure corresponding to an input/output request from said computer when data corresponding to said input/output request does not become cache slot.
 15. The method for controlling a cache memory of a storage device according to claim 14, wherein a link structure in which a use quantity of the cache slot exceeds said minimum guarantee value and said priority is the lowest is selected when said other link structure is selected.
 16. The method for controlling a cache memory of a storage device according to claim 1, wherein control information of a cache memory quantity containing at least one of said priority, said minimum guarantee value and schedule definition defining a setting data of said priority and said minimum guarantee value is set either from a control terminal connected to said storage device or from any one of said plurality of computers.
 17. The method for controlling a cache memory of a storage device according to claim 6, wherein, when said priorities corresponding to some of said computers become the same in each time zone during said scheduling, link structures corresponding to said computers are made the same.
 18. A control device of a storage device connected to a plurality of computers, comprising: a control terminal for setting a storage area having a size of a minimum guarantee value corresponding to each of said computers inside a disk cache memory of said storage device; and a processing unit for allocating a storage area to each of said computers inside storage areas other than the storage area having the size of said minimum guarantee value in accordance with priority corresponding to each of said computers.
 19. A computer-readable recording medium storing a program for executing a cache control method of a storage device connected to a plurality of computers, wherein said method includes the step of setting a storage area having a size of a minimum guarantee value corresponding to each of said computers inside a disk cache memory of said storage device, and allocating a storage area to each of said computers inside storage areas other than the storage area having the size of said minimum guarantee value in according with priority corresponding to each of said computers.
 20. A method for controlling a cache of a storage device in a control device of a storage device connected to a plurality of computers, comprising the steps of: constituting a storage area of a cache memory of said storage device by a plurality of cache slots each having a predetermined memory area; constituting each of said storage areas corresponding to said computers into a link structure in which said cache slots are linked in the sequence of allocation; setting a minimum guarantee value determining the number of cache slots to be minimum guaranteed in such a manner as to correspond to each of said computers; setting priority for allocating said storage area in such a manner as to correspond to each of said computers; and allocating a storage area to each of said computers in at least one cache slot other than the number of cache slots determined by said minimum guarantee value in accordance with said priority. 